package com.salary.entity.dto;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.salary.entity.SalaryRecord;

public class SalaryRecordDTO {
	private Long id;
	private String staffName;
	private String staffNum;
	private float basicSalary;
	private float absence;
	private float _leave;
	private float overtime;
	private float performance;
	private float welfare;
	private float tax;
	private float total;
	private float actual;
	private Date accountTime;

	public SalaryRecordDTO() {
		super();
	}

	public SalaryRecordDTO(SalaryRecord salaryRecord, float basicSalary, String staffName,String staffNum) {
		super();
		this.id = salaryRecord.getId();
		this.staffName = staffName;
		this.staffNum = staffNum;
		this.basicSalary = basicSalary;
		this.absence = salaryRecord.getAbsence();
		this._leave = salaryRecord.get_leave();
		this.overtime = salaryRecord.getOvertime();
		this.performance = salaryRecord.getPerformance();
		this.welfare = salaryRecord.getWelfare();
		this.tax = salaryRecord.getTax();
		this.total = salaryRecord.getTotal();
		this.actual = basicSalary - salaryRecord.getAbsence() - salaryRecord.get_leave() + salaryRecord.getOvertime()
				+ salaryRecord.getPerformance() + salaryRecord.getWelfare() - salaryRecord.getTax();
		this.accountTime = salaryRecord.getAccountTime();
	}

	public Long getId() {
		return id;
	}

	public String getStaffName() {
		return staffName;
	}

	public float getBasicSalary() {
		return basicSalary;
	}

	public float getAbsence() {
		return absence;
	}

	public float get_leave() {
		return _leave;
	}

	public float getOvertime() {
		return overtime;
	}

	public float getPerformance() {
		return performance;
	}

	public float getWelfare() {
		return welfare;
	}

	public float getTax() {
		return tax;
	}

	public float getTotal() {
		return total;
	}

	public float getActual() {
		return actual;
	}

	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
	public Date getAccountTime() {
		return accountTime;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setStaffName(String staffName) {
		this.staffName = staffName;
	}

	public void setBasicSalary(float basicSalary) {
		this.basicSalary = basicSalary;
	}

	public void setAbsence(float absence) {
		this.absence = absence;
	}

	public void set_leave(float _leave) {
		this._leave = _leave;
	}

	public void setOvertime(float overtime) {
		this.overtime = overtime;
	}

	public void setPerformance(float performance) {
		this.performance = performance;
	}

	public void setWelfare(float welfare) {
		this.welfare = welfare;
	}

	public void setTax(float tax) {
		this.tax = tax;
	}

	public void setTotal(float total) {
		this.total = total;
	}

	public void setActual(float actual) {
		this.actual = actual;
	}

	public void setAccountTime(Date accountTime) {
		this.accountTime = accountTime;
	}

	public String getStaffNum() {
		return staffNum;
	}

	public void setStaffNum(String staffNum) {
		this.staffNum = staffNum;
	}
	
}
